<!doctype html>
<html class="no-js">

	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="description" content="美丽说-wap首页,H5,H5首页">
		<meta name="keywords" content="美丽说,穿搭,女装,搭配">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>收藏的宝贝</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="icon" type="image/png" href="assets/i/mfavicon.png">
		<link rel="stylesheet" href="assets/css/amazeui.min.css">
		<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="assets/css/reset.css" />
		<link rel="stylesheet" href="assets/css/my favorite.css">
	</head>

	<body>
		<div class="am-container cons">
			<div class="navs">
				<div class="return">
					<img src="assets/img/re.png" />
				</div>
				<a class="right-btn" href="shop trolley.html">购物车
					<span class="cart_nums">3</span>
				</a>
				<div class="centers">
					<a href="javascript:void(0);">收藏的宝贝</a>
				</div>
			</div>
			<div class="favorite-box am-cf">
				
			</div>
			<div class="no-one">
				<p>木有了...</p>
			</div>
		</div>
		<script src="assets/js/jquery-1.12.4.min.js"></script>
		<script src="assets/js/amazeui.min.js"></script>
		<script src="assets/js/my favorite.js"></script>
		<script src="assets/js/template-web.js" type="text/javascript"></script>
		<script type="text/html" id="collectList">
			{{each data}}
			<div class="favorite-list am-fl">
				<div class="pic_load">
					<a class="bs_load_img" href="details.html?id={{$value.goodsId._id}}">
						<img src="{{$value.goodsId.mdImg}}"/>
					</a>
				</div>
				<p class="clothesTitle">{{$value.goodsId.name}}</p>
				<p>
					<span class="price">￥{{$value.goodsId.price}}</span>
					<span class="like icon-heart">215</span>
				</p>
			</div>
			{{/each}}
		</script>
		<script type="text/javascript">
			var mid = sessionStorage.uid;
			$.getJSON("/api/goodsCollect/",{account:mid},function (result) {
				if (result.status) {
					var id = result.data._id
					$.getJSON("/api/goodsIdList",{accountId:id},function (result) {
						if (result.status) {
							var html = template("collectList", result);
			           		$(".favorite-box").html(html);
						}
					})
					$.getJSON("/api/goods/findNums",{accountId:id},function (result) {
						if (result.status) {
							var trolleyLength = result.data.length
							parseInt($(".cart_nums").text(trolleyLength))
						}
					})
				}
			})
		</script>
	</body>

</html>	